Detect whether or not the terminal supports color.
authorSteven Allen <steven@stebalien.com>
Mon, 1 Feb 2016 01:03:14 +0000 (20:03 -0500)
committerSteven Allen <steven@stebalien.com>
Mon, 1 Feb 2016 21:06:01 +0000 (16:06 -0500)
commitcfcfa08a0a7afb3355889b6f1263c594f9d51bdf
tree10c4d6174e45afd0fa6f70cdc71f3cdb4ce2b7dd
parentfd463d65f9c18bb841b16d2545c953eb995166ee
Detect whether or not the terminal supports color.

Before v0.4, term used to return `Ok(true)` if something succeeded,
`Ok(false)` if the operation was unsupported, and `Err(io::Error)` if
there was an IO error. Now, it returns `Ok(())` if the operation
succeeds and `Err(term::Error)` if the operation fails. If the operation
is unsupported, it returns `Err(term::Error::NotSupported)`. This means
that, if `op` is unsupported, `try!(term.op())` will now return an error
instead of silently failing (well, return false but that's effectively
silent).

Fixes #2338
Cargo.lock
Cargo.toml
src/cargo/core/shell.rs